﻿using CMWVS.Core.Commands;
using CMWVS.Core.Mono;
using System.Diagnostics;

namespace CMWVS.Core
{
    public class MainViewModel
    {
        #region Constructor

        private MainViewModel()
        {
        }

        public MainViewModel(Resolver resolver)
        {
            Trace.Assert(null != resolver);
            this.m_Resolver = resolver;
        }

        #endregion Constructor

        private Resolver m_Resolver;

        private CompileCommand m_Compile;

        public CompileCommand Compile
        {
            get
            {
                if (null == m_Compile)
                {
                    m_Compile = new CompileCommand(m_Resolver);
                }
                return m_Compile;
            }
        }

        private RebuildCommand m_RebuildCommand;

        public RebuildCommand Rebuild
        {
            get
            {
                if (null == m_RebuildCommand)
                {
                    m_RebuildCommand = new RebuildCommand(m_Resolver);
                }

                return m_RebuildCommand;
            }
        }

        private CleanCommand m_CleanCommand;

        public CleanCommand Clean
        {
            get
            {
                if (null == m_CleanCommand)
                {
                    m_CleanCommand = new CleanCommand(m_Resolver);
                }

                return m_CleanCommand;
            }
        }

        private RunCommand m_RunCommand;

        public RunCommand Run
        {
            get
            {
                if (null == m_RunCommand)
                {
                    m_RunCommand = new RunCommand(m_Resolver);
                }

                return m_RunCommand;
            }
        }
    }
}